import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 导入全局样式表
import './assets/css/global.css'
// 导入axios
import axios from 'axios'
import moment from 'moment'
// 导入树标签插件
import TreeTable from 'vue-table-with-tree-grid'
// 导入vue-quill-editor（富文本编辑器）
import VueQuillEditor from 'vue-quill-editor'
// 导入进度条插件
import NProgress from 'nprogress'

Vue.use(VueQuillEditor)
Vue.component('tree-table', TreeTable)

axios.defaults.baseURL = 'https://lianghj.top:8888/api/private/v1/'
axios.interceptors.request.use(config => {
  NProgress.start()
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
axios.interceptors.response.use(config => {
  NProgress.done()
  return config
})
Vue.prototype.$http = axios
Vue.config.productionTip = false

Vue.filter('FormatData', time => { return moment(time).format('YYYY-MM-DD HH:mm:ss') })


new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
